package com.ddtech.business.practice.entity;

import com.baomidou.mybatisplus.annotation.TableName;
import com.ddtech.business.bank.entity.QuestionBankQuestion;
import com.ddtech.business.common.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

/**
 * <p>
 * 练习用户题目信息
 * </p>
 *
 * @author bin_pu
 * @since 2023-05-26
 */
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@NoArgsConstructor
@TableName("practice_user_question")
@ApiModel(value = "PracticeUserQuestion对象", description = "练习用户题目信息")
public class PracticeUserQuestion extends BaseEntity {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "练习id")
    private String practiceId;


    @ApiModelProperty(value = "学员id")
    private String userId;

    @ApiModelProperty(value = "题库问题id")
    private String bankQuestionId;

    @ApiModelProperty(value = "题目固定的题号")
    private Integer questionNum;

    @ApiModelProperty(value = "题目描述")
    private String questionDesc;

    @ApiModelProperty(value = "考察知识点")
    private String knowledgePoint;

    @ApiModelProperty(value = "附件、图片")
    private String questionImg;

    @ApiModelProperty(value = "题型 0单选 1多选")
    private Integer optionType;

    @ApiModelProperty(value = "分值")
    private Double score;

    @ApiModelProperty(value = "试题解析")
    private String answerKey;

    public PracticeUserQuestion(QuestionBankQuestion questionBankQuestion) {
        this.bankQuestionId = questionBankQuestion.getId();
        this.questionNum = questionBankQuestion.getQuestionNum();
        this.knowledgePoint=questionBankQuestion.getKnowledgePoint();
        this.questionDesc = questionBankQuestion.getQuestionDesc();
        this.questionImg = questionBankQuestion.getQuestionImg();
        this.optionType = questionBankQuestion.getOptionType();
        this.score = questionBankQuestion.getScore();
    }
}
